#include <iostream>
#include <cctype>
#include <cstdio>

using namespace std;

string s;

int main()
{
//	freopen("445.in", "r", stdin);

	while (getline(cin, s))
	{
		if (s == "")
		{
			cout << endl;
			continue;
		}

		int count = 0;
		for (int i = 0; i < s.size(); i++)
		{
			if (s[i] == '!') cout << endl;
			else
				if (s[i] == 'b')
				{
					for (int j = 0; j < count; j++) cout << " ";
					count = 0;
				}
				else
					if (isdigit(s[i])) count += s[i] - '0';
					else
					{
						for (int j = 0; j < count; j++) cout << s[i];
						count = 0;
					}
		}
		cout << endl;
	}
	return 0;
}
